home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWResour / Include / SLResour.xh < prev    next >
Encoding:
Text File  |  1996-08-16  |  5.6 KB  |  246 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: SLResour.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  * 
  13.  *     File:                SLResour.idl
  14.  *     Release Version:    $ ODF 1 $
  15.  * 
  16.  *     Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  17.  * 
  18.  * 
  19.  */
  20.  
  21.  
  22. #ifndef SOM_FW_OResource_xh
  23. #define SOM_FW_OResource_xh
  24.  
  25. class FW_OResource;
  26.  
  27. #define FW_OResource_MajorVersion 1
  28. #define FW_OResource_MinorVersion 0
  29.  
  30. /*
  31.  * Passthru lines: File: "C.xh", "before"
  32.  */
  33.  
  34.  
  35. /* C++ SOM defs */
  36. #include <somcls.xh>
  37. #include <somcm.xh>
  38.  
  39. /* C++ parent defs */
  40. #ifndef SOM_FW_ORefCount_xh
  41. #include <SLRefCnt.xh>
  42. #endif
  43.  
  44. #ifndef FW_OResource_API
  45. #define FW_OResource_API
  46. /*
  47.  * -- The Class API
  48.  */
  49.  
  50. /*
  51.  * Start of user-defined types:
  52.  */
  53. class SOMClass;
  54. class SOMObject;
  55. class FW_ORefCount;
  56. class FW_OResource;
  57. typedef
  58. short  FW_ResourceFileID;
  59. typedef
  60. FW_PlatformHandle FW_ResourceHandle;
  61. class shutUpAboutTheCommentAlready;
  62. class FW_OResourceFile;
  63.  
  64. /*
  65.  * End of user-defined types.
  66.  */
  67.  
  68. #ifdef OLDIBMSOMAPISUPPORT
  69. #define FW_OResourceCClassData FW_OResourceClassData
  70. #define FW_OResourceNewClass(major,minor) somNewVersionedClassReference(FW_OResource,major,minor)
  71. #endif
  72.  
  73. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  74. #define FW_OResourceMetaClass SOMClass
  75.  
  76. #if PRAGMA_ALIGN_SUPPORTED
  77. #  pragma options align=power
  78. #endif
  79.  
  80. /* The API to the FW_OResource class object, and the methods it introduces. */
  81. SOMEXTERN struct FW_OResourceClassDataStructure {
  82. #ifdef OLDIBMSOMAPISUPPORT
  83.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  84. #else
  85.     long zero;
  86. #endif
  87.     somStaticClassInfo *sci;
  88.     somDToken        instanceDataToken;
  89.     long reserved [3];
  90.     somMToken somInit;
  91.     somMToken somUninit;
  92.     somMToken InitFromFile;
  93.     somMToken AcquireData;
  94.     somMToken ReleaseData;
  95.     somMToken GetSize;
  96.     somMToken GetResourceHandle;
  97. } SOMDLINK FW_OResourceClassData;
  98.  
  99. #if PRAGMA_ALIGN_SUPPORTED
  100. #  pragma options align=reset
  101. #endif
  102.  
  103. #if !defined(FW_OResource_Class_Source) && !defined(SOM_Module_slresour_Source)
  104. #if PRAGMA_IMPORT_SUPPORTED
  105. #pragma import list FW_OResourceClassData
  106. #endif
  107. #endif
  108.  
  109.  
  110. /*
  111.  * -- Typedefs and inline method declarations for left path inherited methods
  112.  * -- are omitted because this compilation had -museinheritedmethods in effect
  113.  */
  114.  
  115.  
  116. /*
  117.  * -- Typedefs for FW_OResource Method Procedures
  118.  */
  119. SOMEXTERN {
  120. typedef void   (* SOMLINK somTD_FW_OResource_InitFromFile)(FW_OResource *somSelf, Environment *ev,
  121.         FW_OResourceFile* file,
  122.         FW_ResourceId resourceId,
  123.         FW_ResourceType resourceType);
  124. typedef void*   (* SOMLINK somTD_FW_OResource_AcquireData)(FW_OResource *somSelf, Environment *ev);
  125. typedef void   (* SOMLINK somTD_FW_OResource_ReleaseData)(FW_OResource *somSelf, Environment *ev);
  126. typedef unsigned long   (* SOMLINK somTD_FW_OResource_GetSize)(FW_OResource *somSelf, Environment *ev);
  127. typedef FW_ResourceHandle   (* SOMLINK somTD_FW_OResource_GetResourceHandle)(FW_OResource *somSelf, Environment *ev);
  128. }
  129.  
  130. #endif /* FW_OResource_API */
  131.  
  132.  
  133. /*
  134.  * -- This emitter treats Method Tokens as Thunks by default.
  135.  * -- Use the sc modifier "nothunks" to change this default
  136.  */
  137. #undef somresolve_
  138. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  139.  
  140. /*
  141.  * -- The C++ Wrapper Class for FW_OResource
  142.  */
  143. class FW_OResource : public FW_ORefCount
  144. {
  145. public:
  146.  
  147. // FW_OResource::new registers use of the class object, and then uses somNew
  148. // to allocate memory and load the object method table pointer. 
  149. void *operator new(size_t size)
  150. {
  151.     SOM_IgnoreWarning(size);
  152.     // Allocate memory using the default allocator for FW_OResource, and
  153.     // clear mem & set method table pointer, call basic initialization
  154. #ifdef SOMCHKNULL
  155.     void * __somResult = (void *)
  156.       somNewObject(FW_OResource);
  157.     SOMCHKNULL(__somResult);
  158.     return __somResult;
  159. #else
  160.     return (void*) somNewObject(FW_OResource);
  161. #endif
  162. }
  163.  
  164. // FW_OResource::delete uses the default deallocator for the object's class.
  165. void operator delete(void * obj)
  166. {
  167.     if (obj) {
  168.         SOM_Resolve(obj,SOMObject,somFree)
  169.            ( (SOMObject*) obj );
  170.     }
  171. }
  172.  
  173. /* method: InitFromFile */
  174. void   InitFromFile(Environment *ev,
  175.         FW_OResourceFile* file,
  176.         FW_ResourceId resourceId,
  177.         FW_ResourceType resourceType)
  178. {
  179.    SOM_ResolveD(this,FW_OResource,FW_OResource,InitFromFile)
  180.     (this,ev,file,resourceId,resourceType);
  181. #ifdef SOMCHKEXCEPT
  182.       SOMCHKEXCEPT;
  183. #endif
  184. }
  185.  
  186. /* method: AcquireData */
  187. void*   AcquireData(Environment *ev)
  188. {
  189.    #ifdef SOMCHKEXCEPT
  190.    void* __somResult = 
  191.       SOM_ResolveD(this,FW_OResource,FW_OResource,AcquireData)
  192.     (this,ev);
  193.       SOMCHKEXCEPT;
  194.    return __somResult;
  195. #else
  196.    return SOM_ResolveD(this,FW_OResource,FW_OResource,AcquireData)
  197.     (this,ev);
  198. #endif
  199. }
  200.  
  201. /* method: ReleaseData */
  202. void   ReleaseData(Environment *ev)
  203. {
  204.    SOM_ResolveD(this,FW_OResource,FW_OResource,ReleaseData)
  205.     (this,ev);
  206. #ifdef SOMCHKEXCEPT
  207.       SOMCHKEXCEPT;
  208. #endif
  209. }
  210.  
  211. /* method: GetSize */
  212. unsigned long   GetSize(Environment *ev)
  213. {
  214.    #ifdef SOMCHKEXCEPT
  215.    unsigned long __somResult = 
  216.       SOM_ResolveD(this,FW_OResource,FW_OResource,GetSize)
  217.     (this,ev);
  218.       SOMCHKEXCEPT;
  219.    return __somResult;
  220. #else
  221.    return SOM_ResolveD(this,FW_OResource,FW_OResource,GetSize)
  222.     (this,ev);
  223. #endif
  224. }
  225.  
  226. /* method: GetResourceHandle */
  227. FW_ResourceHandle   GetResourceHandle(Environment *ev)
  228. {
  229.    #ifdef SOMCHKEXCEPT
  230.    FW_ResourceHandle __somResult = 
  231.       SOM_ResolveD(this,FW_OResource,FW_OResource,GetResourceHandle)
  232.     (this,ev);
  233.       SOMCHKEXCEPT;
  234.    return __somResult;
  235. #else
  236.    return SOM_ResolveD(this,FW_OResource,FW_OResource,GetResourceHandle)
  237.     (this,ev);
  238. #endif
  239. }
  240.  
  241. };   /* FW_OResource */
  242.  
  243.  
  244.  
  245. #endif       /* SOM_FW_OResource_xh */
  246.